<!DOCTYPE html>
<!-- v1.6.6.2 RDPROJECT-277 xx 2013-10-27 start -->
<!-- 新增页面 -->
<!-- v1.6.6.2 RDPROJECT-277 xx 2013-10-27 end -->
<html>
<#include "../include/resource.html"> 
<body>
<#assign nid="fund">
<#include "../include/header.html">
<#include "../common/function.html"> 
	<!--子栏目 开始-->

	<!--子栏目 结束-->

	<!--header-end-->

<div class="container">
	<div class="investbox">
	<div id="main" class="clearfix">
		<form action="" method="get">
			<div class="box">
				<div class="box-title">详细搜索</div>
				<div class="box-con" style="background:#f5f5f4; padding:15px 20px; border:1px solid #ddd;border-top:none;">
					<ul class="select-A clearfix">
                    	<li>关 键 字：<input type="text" name="keywords" size="20" value="${(param.keywords)!}" /></li>
						<li>类 型：<@linkage name="type" id="type" default="${param.type}" type="value" nid="fund_type" noselect="全部"/></li>
						
						<input type="submit" class="btn-action" id="search_btn" value="搜索"  />
						<input type="hidden" name="status" value="${status!1}"> 
						<input type="hidden" name="search" value="select">
					</ul>
				</div>
			</div>
		</form>
        <div class="investlist mt10">
            <div class="title-greybg">
                <div class="title-redbg">
					<#if status?? && status==1>发布中的基金信托<#elseif status?? && status==8>已完成的基金信托</#if>
                </div>
            </div>
            <div class="list-select clearfix">
				<div class="list-select-l">
					排序：
					<span><a class='searchbtn' href="?status=${param.status?if_exists}&order=0&keywords=${param.keywords?if_exists}&type=${param.type?if_exists}"><#if param.order=='0'><font color="#FF0000"></#if>时间<#if param.order=='0'></font></#if></a></span>
					<span><a class='searchbtn' href="?status=${param.status?if_exists}&order=<#if param.order=='1'>-1<#else>1</#if>&keywords=${param.keywords?if_exists}&type=${param.type?if_exists}"><#if param.order=='1' || param.order=='-1'><font color="#FF0000"></#if>金额<#if param.order=='1'>↑<#else>↓</#if><#if param.order=='1' || param.order=='-1'></font></#if></a></span>
					<span><a class='searchbtn' href="?status=${param.status?if_exists}&order=<#if param.order=='2'>-2<#else>2</#if>&keywords=${param.keywords?if_exists}&type=${param.type?if_exists}"><#if param.order=='2' || param.order=='-2'><font color="#FF0000"></#if>利率<#if param.order=='2'>↑<#else>↓</#if><#if param.order=='2' || param.order=='-2'></font></#if></a></span>
					<span><a class='searchbtn' href="?status=${param.status?if_exists}&order=<#if param.order=='3'>-3<#else>3</#if>&keywords=${param.keywords?if_exists}&type=${param.type?if_exists}"><#if param.order=='3' || param.order=='-3'><font color="#FF0000"></#if>进度<#if param.order=='3'>↑<#else>↓</#if><#if param.order=='3' || param.order=='-3'></font></#if></a></span>
				</div><!-- 排序 -->
				<div class="list-select-r2"></div>
			</div>
			
			<#if list?exists && list?size gt 0>
	            <div class="listmain">
	                 <#list list as item>
		                 <div class="list-div">
							<a href="${webroot}/fund/detail.html?fundId=${item.id?c}">
								<div class="itam-img">
									<img src="<#if item.pic??>${webroot}${item.pic}</#if>" class="productimg"/>
								</div>
							</a>
							<ul class="list-ul">
								<li class="titleli" style="position: relative;">
									<span>
										<a href="${webroot}/fund/detail.html?fundId=${item.id?c}" class="titletxt">
											<#if item.name?length lt 20>${item.name}<#else>${item.name[0..10]}...</#if>&nbsp;&nbsp;
										</a>
									</span>
									<a rel="tooltip" class="aimg">
			           					<img src="${webroot}${theme_dir}/images/<#if item.type==1>jijin<#elseif item.type==2>xintuo</#if>.png" border="0" />
			        				</a>
									<span style="font-size: 14px; position: absolute; left: 390px;">
										<b>募集资金：￥</b>
										<strong><font color="red">${format2(item.account?c)}万</font></strong>
									</span>
								</li>
								<li>预计年化收益：${item.apr}%</li>
								<#assign scales=item.accountYes/item.account>
								<li class="clearfix">
									<div class="float_left">已完成：</div>
									<div class="jindu float_left">
										<div class="rate_tiao" style="width:
											<#if ((scales*100)?string("##.######"))?number -99.99 lte 0.01 && ((scales*100)?string("##.######"))?number -99.99 gte 0>
											99.9%
											<#else>
											${(scales*100)?string("##.##")}%
											</#if>">
										</div>
									</div>
									<div class="float_left">&nbsp; <#if
										((scales*100)?string("##.######"))?number -99.99 lt 0.01 &&
										((scales*100)?string("##.######"))?number -99.99 gt 0> 99.99%
										<#else> ${(scales*100)?string("##.##")}% </#if>
									</div>
								</li>
								<li>
									产品期限：<strong>${item.timeLimit}</strong><#if item.isDay==1>天<#else>个月</#if>
								</li>
								<li>
									<#if item.status==1>剩余时间：<@showRemainTime addtime=item.addTime?c valid_time=item.validTime />
									<#elseif item.status==8>已结束
									<#else>-
									</#if>
								</li>
								<li>最低认购金额：${item.lowestAccount?c}万</li>
								<li>担保机构：${item.guaranty}</li>
								<li>反担保方式：<#if item.counterGuaranty==1>土地抵押<#elseif item.counterGuaranty==2>特定股权质押</#if></li>
								<li>
									 收益分配方式：
									<#if item.style==1>一次性
									<#elseif item.style==2>按月分配
									<#elseif item.style==3>按季度分配
									<#elseif item.style==4>每月返息 到期还本
									</#if>
								</li>
							</ul>
							<div class="list-btnbox">
								<a href="${webroot}/fund/detail.html?fundId=${item.id?c}" class="list-btn">
									<#if item.status==0>
										暂未开启
									<#elseif item.status==8>
										已结束
									<#elseif item.status==1 && (getRemainTime(item.addTime?c,item.validTime)?number lt 0)>
										已过期
									<#elseif item.status==1 && (item.accountYes lt item.account)>
										我要认购
									<#else>
										已结束
									</#if>
								</a>
							</div>
						</div>
	                 </#list>
	            </div>
	            
	            <div align="center" class="mt10">
	            	<#import "../common/page.html" as pager>
	            	<@pager.pagination page=page url="/fund/index.html" map=param style="style1" />
	            </div>
            <#else>
            	<div align="center" >目前没有相关信息</div>
            </#if>
        </div>
    </div>
    </div>
</div>
<!--main end-->
<script type="text/javascript">
function showRemainTime(){
	var endtimes=$(".endtime");
	endtimes.each(function(){
		RemainTime($(this));
	});
}
showRemainTime();
setInterval("showRemainTime()",1000);

function RemainTime(t){
	var iDay,iHour,iMinute,iSecond,account;
	var sDay="",sTime="";
	var at="data-time"
	var iTime=t.attr(at);
    if (iTime >= 0){
    	iDay = parseInt(iTime/24/3600);
        iHour = parseInt((iTime/3600)%24);
        iMinute = parseInt((iTime/60)%60);
        iSecond = parseInt(iTime%60);
    	if (iDay > 0){ 
   			sDay = iDay + "天"; 
    	}
	    sTime =sDay + iHour + "小时" 
/* 	    + iMinute + "分钟" + iSecond + "秒"
 */	    ;
	    if(iTime==0){
        	sTime="<span style='color:green'>时间到了！</span>";
        }
			t.attr(at,iTime-1);
      }else{
	     sTime="<span style='color:red'>已过期</span>";
	 }
	t.html(sTime);
	}
</script>
	<script src="${request.getContextPath()}${theme_dir}/media/js/tab.js"></script>
	<script src="${request.getContextPath()}${theme_dir}/media/js/transition.js"></script>
	<script src="${request.getContextPath()}${theme_dir}/media/js/tooltip.js"></script>
	<script src="${request.getContextPath()}${theme_dir}/media/js/popover.js"></script>
	<#include "../include/footer.html"> 
</body>
</html>
